home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / amos / AMOS1097.lzh / AMOSLIST / 000052_amos-request@svcs1.digex.net_Fri Oct 3 14:12:58 1997.msg < prev    next >
Internet Message Format  |  1997-11-02  |  3KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail4.access.digex.net (8.8.5/8.8.5) with ESMTP id OAA27663
  3.     for <mcox@access.digex.net>; Fri, 3 Oct 1997 14:12:56 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id KAA13372
  6.     for amos-out; Fri, 3 Oct 1997 10:33:17 -0400 (EDT)
  7. Received: from mail4.access.digex.net (mail4.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id KAA13369
  9.     for <amos-list@svcs1.digex.net>; Fri, 3 Oct 1997 10:33:16 -0400 (EDT)
  10. Received: from relay2.inet.tele.dk (relay2.inet.tele.dk [194.182.149.120])
  11.     by mail4.access.digex.net (8.8.5/8.8.5) with SMTP id KAA00207
  12.     for <amos-list@access.digex.net>; Fri, 3 Oct 1997 10:33:08 -0400 (EDT)
  13. Received: (qmail 63638 invoked from network); 3 Oct 1997 14:32:55 -0000
  14. Received: from post8.tele.dk (194.239.134.172)
  15.   by relay2.inet.tele.dk with SMTP; 3 Oct 1997 14:32:55 -0000
  16. Received: from post8.tele.dk ([194.239.180.85]) by post8.tele.dk
  17.           (Netscape Mail Server v2.02) with SMTP id AAB40966;
  18.           Fri, 3 Oct 1997 16:32:51 +0200
  19. From: Jens Vang Petersen <top_cat@post8.tele.dk>
  20. To: Peter Falkesand <peter.falkesand@vux.alingsas.se>
  21. CC: amos-list@access.digex.net
  22. Date: Fri, 03 Oct 1997 16:30:34 +0100
  23. Message-ID: <yam7215.1717.1747442928@post8.tele.dk>
  24. In-Reply-To: <199710030432.GAA00597@vux.alingsas.se>
  25. X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
  26. Subject: Re: Sorting routine.
  27. MIME-Version: 1.0
  28. Content-Type: text/plain
  29. Status: O
  30. X-Status: 
  31.  
  32. On 03-Okt-97, Peter Falkesand smashed the keyboard with:
  33. >Hi!
  34.  
  35. >Is there a smooth way to sort 20 variables???
  36. >and not do like this..
  37.  
  38. >--------------------------------
  39.  
  40. >If score1_1(1)>score2_1(1)
  41.  
  42. >Loke S7+40,Leek(S5+20)
  43.  
  44. >endif
  45.  
  46. >if score1_2(2)>score2_1(1)
  47.  
  48. >loke s7+60,leek(s5+40)
  49.  
  50. >endif
  51.  
  52. >-------------------------------
  53. *sigh*, that's BIG
  54.  
  55. >This way makes the program very big..!
  56. >Any soloution anyone????
  57.  
  58. This is from memory, so might not be perfect:
  59.  
  60. L=$7FFFFFFF 
  61. For A=1 to 20
  62.    T=-1 : SN=-1
  63.    For B=2 to 20
  64.       If SCORE(B)>T and SCORE(B)<L
  65.          T=SCORE(B) : SN=B 
  66.       Endif
  67.    Next B
  68.    If SN>-1
  69.       'SN will hold the index-number of the score
  70.       'Put is down where you'd like it to be
  71.       'A holds the rating of the score (1=High, 20=Low)
  72.    Else
  73.       Exit
  74.    Endif
  75.    L=T 
  76. Next A
  77.  
  78. NOTE: This won't handle two equal scores (I'll lose one of 'em), but that
  79. should not be so hard to handle (Let me know if you got problems with it)
  80.  
  81. -- 
  82. Happy greetings, Yours..
  83. __________________________________________________________________________
  84.  /_  __/ __  / __  /\  ___\  __ \__  _\           aka. JENS VANG PETERSEN
  85.   / / / /_/ / ____/  \ \___\  __ \ \ \  Nyvej 8, DK-4450 Jyderup, Denmark
  86.  /_/ /_____/_/        \_____\_\ \_\ \_\             top_cat@post8.tele.dk
  87. --------------------------------------------------------------------------
  88.  Never forget the 'Queen Of Hearts', Diana, Princess Of Wales, 1961->1997
  89. --------------------------------------------------------------------------
  90.